public class CPU() {
	int speed;
	void setSpeed(int m) {
		speed=m;
	}
	int getSpeed(){
		return speed;
	}
public class HardDisk() {
	int amount;
    void setAmount(int m) {
		amount=m;
	}
	int getAmount() {
		return amount;
	}
}
public class PC() {
	CPU cpu;
	HardDisk HD;
	void setCPU(CPU c) {
		cpu=c;
	}
	void setHardDisk(HardDisk h) {
		HD=h;
	}
	public void show() {
		System.out.println('CPU速度'+cpu.getSpeed+'硬盘容量'+HD.getAmount);
	}
}
public class Test {
	public static void main(String args[]) {
		CPU cpu=new CPU();
		HardDisk disk=new HarDdisk();
		PC pc=new PC();
		cpu.setSpeed(2200);
		disk.setAmount(200);
		pc.setCPU(cpu);
		pc.setHardDisk(disk);
		pc.show();
	}
}

